<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品二级菜单</title>
    <style>
        *{margin: 0;padding: 0;box-sizing: border-box;}
        ul{
            list-style: none;
        }
        li{
            cursor: pointer;
            text-align: center;
            width: 180px;
            height: 60px;
            line-height: 60px;
            background: rgb(51,120,168);
            border-top: 1px solid #ccc;
            color: #fff;
        }
        .menu{
            background: #ccc;margin: 0 auto;
            width: 800px;height: 360px;
            position: relative;
        }
        .fl{float: left;}
        .con{
            display: none;
            padding-left: 20px;
            position: absolute;
            top: 0;right: 0;
            width: 620px;height: 350px;
            background: rgb(204,204,204);
        }
        li.active{
            background: rgb(169, 255, 10);
            color: #000;
        }
        .con.on{
            display: block;
            font-size: 30px;
            color: #000;
        }
        .menu>div{
            font-size: 30px;
            text-align: center;
            width: 620px;
            height: 360px;
            line-height: 360px;
        }
    </style>
</head>
<body>
    <div class="menu">
        <ul class="fl menu-nav">
            <li>
                <div>商品1</div>
                <div class="con">内容1</div>
            </li>
            <li>
                <div>商品2</div>
                <div class="con">内容2</div>
            </li>
            <li>
                <div>商品3</div>
                <div class="con">内容3</div>
            </li>
            <li>
                <div>商品4</div>
                <div class="con">内容4</div>
            </li>
            <li>
                <div>商品5</div>
                <div class="con">内容5</div>
            </li>
            <li>
                <div>商品6</div>
                <div class="con">内容6</div>
            </li>
        </ul>
        <div class="fl">轮播图</div>
    </div>
    <script>
        let lis = document.querySelectorAll('li')

        lis.forEach((li,i)=>{
            li.onmouseover=()=>{
                li.classList.add('active')
                if(li.children[1]){
                    li.children[1].classList.add('on')
                }
            }
            li.onmouseout=()=>{
                li.classList.remove('active')
                if(li.children[1]){
                    li.children[1].classList.remove('on')
                }
            }
        })
    </script>
</body>
</html>